package org.pub.fast.jdbc.cross.nativejdbc;

public class NativeJdbcExtractorFactory {
	private static NativeJdbcExtractor nativeJdbcExtractor = null;
	private static boolean isRunningInWebSphere = false;
	private static boolean isRunningInWeblogic = false;

	static public NativeJdbcExtractor createJdbcExtractor() {

		if (nativeJdbcExtractor == null) {
			synchronized (NativeJdbcExtractorFactory.class) {
				if (nativeJdbcExtractor == null) {
					if (isRunningInWebSphere) {
						nativeJdbcExtractor = new WebSphereNativeJdbcExtractor();
					} else if(isRunningInWeblogic) {
                        nativeJdbcExtractor = new WeblogicNativeJdbcExtractor();
                    }else {
						nativeJdbcExtractor = new TomNativeJDBCExtractor();
					}
				}
			}
		}

		return nativeJdbcExtractor;
	}
}
